<template>

  <br><input v-model="status" type="checkbox" name="" id=""> <br>
  <input v-model="title" type="text"> <br>
  <input v-model="content" type="text"> <br>
  <button @click="FaBuHandeler">发布</button>
</template>

<script setup>
import { ref } from 'vue';
import { FaBuAPI } from '../api/api'
import { useRouter } from 'vue-router';
let router = useRouter()
//发布
let title = ref('')
let content = ref('')
let status = ref(true)

// function FaBuHandeler() {
// }

const FaBuHandeler = () => {
  console.log(title.value, content.value, status.value);
  FaBuAPI(title.value, content.value, status.value).then(r => {
    console.log(r.data);
    router.push('/')
  }).catch(error => {
    console.log('失败返回的数据' + error);
  })
}


</script>
<style lang='css' scoped></style>